package self.niu.com.resume.ui;


import android.app.ProgressDialog;
import android.content.Context;

/**
 * Created by Administrator on 2015/8/19.
 */
public class ProgressUtils {
    private static ProgressUtils progressUtils;
    private ProgressDialog processDia;
//    private AlertDialog progressDialog;
//    private AlertDialog.Builder builder;

    private ProgressUtils() {

    }

    public static ProgressUtils getInstances() {
        if (progressUtils == null) {
            progressUtils = new ProgressUtils();
        }
        return progressUtils;
    }


    public void showProgress(Context context) {
//        builder = new AlertDialog.Builder(context);
//        View view = LayoutInflater.from(context).inflate(R.layout.item_progress,null);
//        progressDialog = builder.setView(view)
//                .setCancelable(true)
//                .show();

        processDia = new ProgressDialog(context);
//        processDia.setTitle("进度条框标题");
        processDia.setMessage("正在努力加载中...");
        processDia.setIndeterminate(true);
        processDia.setCancelable(true);
        processDia.show();
    }

    public void hideProgress() {
//        if(progressDialog !=null){
//            progressDialog.dismiss();
//            progressDialog = null;
//        }
        if (processDia != null) {
            processDia.dismiss();
            processDia = null;
        }
    }

        /*读取中的对话框*/
//    private void showProcessDia() {
//        processDia = new ProgressDialog(this);
////        processDia.setTitle("进度条框标题");
//        processDia.setMessage("正在努力加载中...");
//        processDia.setIndeterminate(true);
//        processDia.setCancelable(false);
//        processDia.show();
//    }

}
